///
/// Override the CreateWhereClause to retrieve the record id.
///
public override WhereClause CreateWhereClause()
{
WhereClause wc = new WhereClause();
// Get the XML-encoded record ID from the URL parameter.
// This will return something like: EmployeeID1
//
//
// EmployeeID
// 1
//
//
// cv means column value
// c means column name
// v means value
// Retrieve the record id from the URL parameter.
string recId = this.Page.Request.QueryString["${Table Name}"];
if (recId == null || recId.Length == 0)
{
// Get the error message from the application resource file.
throw new Exception(Page.GetResourceValue("Err:UrlParamMissing", "${Application Name}").Replace("{URL}", "${Table Name}"));
}
KeyValue pkValue = KeyValue.XmlToKey(recId);
wc.iAND(${${Table Name}ClassName}.${Primary Key field}, BaseClasses.Data.BaseFilter.ComparisonOperator.EqualsTo, pkValue.GetColumnValue(${${Table Name}ClassName}.${Primary Key field}).ToString());
return wc;
}
|